//
//  UIImage+kkkk_LoadBundleImage.m
//  kratos_framework_Example
//
//  Created by 7yao.top on 2018/10/24.
//  Copyright © 2018年 kratos_framework. All rights reserved.
//

#import "UIImage+kkkk_LoadBundleImage.h"
#import "Kratos_baseView.h"
#import "k_const.h"
#import "Kratos_Options.h"
#import "Kratos_HttpConfigure.h"

@implementation UIImage (kkkk_LoadBundleImage)
+  (instancetype)Kratos_setBundleImageName:(NSString *)imageName
{
    UIImage *image = [[UIImage imageWithContentsOfFile:[[self kk_bundle] pathForResource:imageName ofType:@"png"]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    return image;
}


 + (NSBundle *)kk_bundle
{
    static NSBundle *bundle = nil;
    if (bundle == nil) {
       NSString *bundleName =   [Kratos_HttpConfigure sharedHttpConfigure].Kra_option.Kratos_bundleName;

        bundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[Kratos_baseView class]] pathForResource:bundleName ofType:@"bundle"]];
        
        
    }
    return bundle;
}


@end
